<template>
  <div class="parentWrapper">
    <Parent :parentData="parentData.parent" v-if="parentData.parent" />

    <div class="info">
      <div class="name">{{parentData.user.nickname}}</div>
      <div class="date">{{parentData.create_date.split('T')[0]}}</div>
      <div class="replyBtn" @click="callReply">回复</div>
    </div>
    <div class="mainContent">{{parentData.content}}</div>
  </div>
</template>

<script>
import Bus from "@/utils/Bus";
export default {
  name: "Parent",
  props: ["parentData"],
  methods: {
    callReply() {
      Bus.$emit("callReply", this.parentData.id);
    },
  },
};
</script>

<style lang="less" scoped>
.parentWrapper {
  border: 1px solid #e4e4e4;
  padding: 10/360 * 100vw;
  .info {
    display: flex;
    align-items: center;
    .name {
      font-size: 14/360 * 100vw;
    }
    .date {
      flex: 1;
      padding-left: 10/360 * 100vw;
      font-size: 12/360 * 100vw;
    }
    .replyBtn {
      font-size: 14/360 * 100vw;
      color: #888;
    }
  }
  .mainContent {
    padding: 10/360 * 100vw 0;
    color: #333;
  }
}
</style>